home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 2
/
Merciful - Disc 2.iso
/
software
/
d
/
devioustools19.dms
/
devioustools19.adf
/
utils
/
009.lzx
/
Insert_File.macro
< prev
next >
Wrap
Text File
|
1979-01-11
|
2KB
|
68 lines
/* Final Writer Include File Macro
12/12/92
W.PURSEL
(modified 12/26/93 by David Jarvis, for use in Final Writer)
Final Writer does not incorporate an 'include file'
function. This macro tries to provide that capability.
The following assumptions are made:
1) The Final Writer window open has the document loaded that
you want to incorporate other text into.
2) The cursor is placed at the location where you want to include
the new file.
3) The file you are including is either another Final Writer document or
an ASCII file. If you are including text from an ASCII file, you
should establish your ASCII I/O preferences as needed.
*/
/* $VER: Insert_File 2.0 W.Pursell/dlj (26.12.93) */
hostname = address() /* Get host name */
listb = '' /* Get list of all open Final Writer windows */
answer = show(Ports) /* before opening include text */
do while answer ~= ''
parse var answer . "FINALW." windownum answer
if windownum ~= '' then do
listb = listb || '-' || windownum
end
end
Open /* Get file requestor to open new file */
lista = '' /* Get list of all open Final Writer windows */
quit = 0 /* after OPEN */
do while ~quit
answer = show(Ports)
do while answer ~= ''
parse var answer . "FINALW." windownum answer
if windownum ~= '' then do
lista = lista || '-' || windownum
end
end
if lista ~= listb then quit = 1 /* End loop when new host shows up */
else lista = ''
end
newwin = right(lista,1) /* Get most recent Final Writer host number */
interpret "ADDRESS" "FINALW."newwin /* Talk to new host number */
SelectAll /* Select all the text */
Cut /* Cut the text to the clipboard */
Close force /* Get rid of the new window */
interpret "ADDRESS" hostname /* Talk to the original window again */
Paste /* Paste the clipboard text at the cursor */
Exit